public class InsertionSort implements Sorter {
	public SortResult sort(int[] array) {
		int copies = 0;
		for (int i = 0; i < array.length; i++) {
			int k = array[i];
			//int pos = ArrayUtil.findIndexToInsert(k, array);
			int j;
			for(j = i-1; j>=0&&array[j]>k; j--)
			{
				array[j+1]=array[j];
				copies++;
			}
			array[j+1]=k;
		}
		return new SortResult(array, 0, copies);
	}
}
